//
//  GKCustomAlertView.h
//  jinwan
//
//  Created by 王尧 on 2017/6/6.
//  Copyright © 2017年 wy. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "GKTransactionPasswordView.h"

typedef void (^ForgetPasswordActionBlock)();

@interface GKCustomAlertView : UIView

/** 弹框 */
@property (nonatomic, strong) UIView    *alertView;
/** 标题 */
@property (nonatomic, strong) UILabel   *titleLable;
/** 内容 */
@property (nonatomic, strong) UILabel   *contentLable;
/** 确认 */
@property (nonatomic, strong) UIButton  *sureButton;
/** 取消 */
@property (nonatomic, strong) UIButton  *cancelButton;

/** 确认按钮 只有调用 ' - initWithTextFieldViewTitle ' 才会用到*/
@property (nonatomic, strong) UIButton *textViewSureButton;
/** 自定义View */
@property (nonatomic, strong) UIView *customView;

/** 只有调用 ' - initWithTextFieldViewTitle '时才用到 */
@property (nonatomic, strong) GKTransactionPasswordView *passwordView;
@property (nonatomic, copy) ForgetPasswordActionBlock forgetPwBlock;

/** 仅在确认投资页输入密码，投资失败时调用 */

- (void)updateCustomAlertWithErrorMessage:(NSString *)msg;


/**
 自定义弹框 buttonIndex (0-取消，1-确认)

 @param title 提示
 @param message 内容
 @param sureTitle 确认标题
 @param cancleTitle 取消标题
 @param block 点击时间
 @return 弹框
 */
- (instancetype)initWithTitle:(NSString *)title message:(NSString *)message sureTitle:(NSString *)sureTitle cancleTitle:(NSString *)cancleTitle handler:(void (^)(GKCustomAlertView *alertView, NSInteger buttonIndex))block;

/**
 自定义弹框 buttonIndex (0-取消，1-确认, 2-忘记密码)
 
 @param title 提示
 @param sureTitle 确认标题
 @param cancleTitle 取消标题
 @param block 点击时间
 @return 弹框
 */
- (instancetype)initWithTextFieldViewTitle:(NSString *)title sureTitle:(NSString *)sureTitle cancleTitle:(NSString *)cancleTitle  handler:(void (^)(GKCustomAlertView *alertView, NSInteger buttonIndex))block;
/** 只有调用 ' - initWithTextFieldViewTitle '时才用到 */
- (void)dismissAlertView;

/**
 显示弹框
 */
- (void)alertShow;

/**
 提示的便利构造器
 只有确定按钮
 
 @param message 信息内容
 @param completionBlock 点击回调
 */
+ (void)showSureAlertWithMessage:(NSString *)message completionBlock:(void(^)())completionBlock;


/**
 提示框的便利构造器
 只有取消按钮
 @param message 消息内容
 @param completionBlock 点击回调
 */
+ (void)showCancleAlertWithMessage:(NSString *)message completionBlock:(void(^)())completionBlock;


/**
 提示框的便利构造器
 取消按钮和确定按钮
 @param message 消息内容
 @param completionBlock 点击回调
 */
+ (void)showAlertWithMessage:(NSString *)message completionBlock:(void(^)(NSUInteger buttonIndex))completionBlock;


/**
 没有取消按钮和确定按钮只有标题和内容
 
 @param message 消息内容
 @param delayTime 延迟时间消失
 */
+ (void)showAlertWithMessage:(NSString *)message delayAfter:(CGFloat)delayTime;


/**
 没有取消按钮和确定按钮只有标题和内容
 默认1.5秒消失
 
 @param message 消息内容
 */
+ (void)showAlertWithMessage:(NSString *)message;

/**
 提示框的便利构造器
 取消按钮和确定按钮,交易密码,忘记交易密码
 @param message 消息内容
 @param completionBlock 点击回调 buttonIndex (0-取消，1-确认, 2-忘记交易密码)
 */
+ (GKCustomAlertView *)showTradePasswordAlertWithMessage:(NSString *)message completionBlock:(void (^)(GKCustomAlertView *alertView, NSInteger buttonIndex))completionBlock;


/**
 提现交易密码便利构造器
 
 @param message 内容
 @param completionBlock 点击回调 buttonIndex (0-取消，1-确认, 2-忘记交易密码)
 @return GKCustomAlertView
 */
+ (GKCustomAlertView *)showDrawTradePasswordAlertWithMessage:(NSString *)message completionBlock:(void (^)(GKCustomAlertView *alertView, NSInteger buttonIndex))completionBlock;

@end
